package cn.tuling;


public class ObjectAdapterTest {
    public static void main(String[] args) {
        Adaptee_ adaptee_ = new Adaptee_();
        TargetInterface_ targetInterface_ = new Adapter_(adaptee_);
        targetInterface_.request();
    }
}

class Adaptee_ {
    public void specificRequest() {
        System.out.println("适配者类被调用。");
    }
}

interface TargetInterface_ {
    void request();
}

class Adapter_ implements TargetInterface_ {
    private Adaptee_ adaptee_;

    public Adapter_(Adaptee_ adaptee_) {
        this.adaptee_ = adaptee_;
    }

    @Override
    public void request() {
        adaptee_.specificRequest();
    }
}


